package com.shanpin.shebao.model;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

/**
 * 订单
 * @author 
 *
 */
public class PayOrder {
	
	/**
	 * 订单号
	 */
	private String order_no;
	
	/**
	 * 支付流水号
	 */
	private String pay_no;
	
	/**
	 * 支付的用户标识
	 */
	private int pay_uid;
	
	/**
	 * 支付渠道(微信、支付宝)
	 */
	private int channels;
	
	/**
	 * 支付金额数目 
	 */
	private BigDecimal prices;
	
	/**
	 * 支付帐单类型(0社保、1公积金)  
	 */
	private int pay_for;
	
	/**
	 * 支付时间  
	 */
	private Date pay_time;
	
	/**公积金金额
	 * 
	 */
	private BigDecimal funds;
	
	/**
	 * 支付状态
	 */
	private int pay_status;
	
	/**
	 * 月份
	 */
	private int for_month;
	
	/**
	 * 是否新办社保卡
	 */
	private int new_card;
	
	/**
	 * 手动支付0、代扣1
	 */
	private int isAuto;

	public BigDecimal getFunds() {
		return funds;
	}

	public void setFunds(BigDecimal funds) {
		this.funds = funds;
	}

	public String getOrder_no() {
		return order_no;
	}

	public void setOrder_no(String order_no) {
		this.order_no = order_no;
	}

	public String getPay_no() {
		return pay_no;
	}

	public void setPay_no(String pay_no) {
		this.pay_no = pay_no;
	}

	public int getPay_uid() {
		return pay_uid;
	}

	public void setPay_uid(int pay_uid) {
		this.pay_uid = pay_uid;
	}


	public int getPay_for() {
		return pay_for;
	}

	public void setPay_for(int pay_for) {
		this.pay_for = pay_for;
	}

	public int getChannels() {
		return channels;
	}

	public void setChannels(int channels) {
		this.channels = channels;
	}

	public BigDecimal getPrices() {
		return prices;
	}

	public void setPrices(BigDecimal prices) {
		this.prices = prices;
	}

	public Date getPay_time() {
		return pay_time;
	}

	public int getFor_month() {
		return for_month;
	}

	public void setFor_month(int for_month) {
		this.for_month = for_month;
	}

	public int getNew_card() {
		return new_card;
	}

	public void setNew_card(int new_card) {
		this.new_card = new_card;
	}

	public int getIsAuto() {
		return isAuto;
	}

	public void setIsAuto(int isAuto) {
		this.isAuto = isAuto;
	}

	public static RowMapper<PayOrder> getDetailMapper() {
		return detailMapper;
	}

	public static void setDetailMapper(RowMapper<PayOrder> detailMapper) {
		PayOrder.detailMapper = detailMapper;
	}

	public void setPay_time(Date pay_time) {
		this.pay_time = pay_time;
	}

	public static RowMapper<PayOrder> detailMapper = new RowMapper<PayOrder>() {

		@Override
		public PayOrder mapRow(ResultSet rs, int rowNum) throws SQLException {
			PayOrder p = new PayOrder();
			p.setPrices(rs.getBigDecimal("prices"));
			p.setOrder_no(rs.getString("order_no"));
			p.setChannels(rs.getInt("channels"));
			p.setPay_for(rs.getInt("pay_for"));
			p.setPay_no(rs.getString("pay_no"));
			p.setPay_time(rs.getTimestamp("pay_time"));
			p.setPay_uid(rs.getInt("pay_uid"));
			p.setFunds(rs.getBigDecimal("funds"));
			p.setPay_status(rs.getInt("pay_status"));
			p.setFor_month(rs.getInt("for_month"));
			p.setIsAuto(rs.getInt("isAuto"));
			p.setNew_card(rs.getInt("new_card"));
			return p;
			
		}
	};
	


	public int getPay_status() {
		return pay_status;
	}

	public void setPay_status(int pay_status) {
		this.pay_status = pay_status;
	}}
